草庐IT

带类别的 Android GridView?

全部标签

php - Magento 类别中只有活跃的产品

我正在尝试显示每个类别中的产品数量,使用此代码我想显示类别id:3的子类别。它正在展示,但其中包含禁用和不可见的产品。load(3)->getChildrenCategories();?>getUrl()?>">getName()?>(getProductCount();?>)是否有任何好的解决方案,以便我可以获得已启用和事件的类别的确切数量。 最佳答案 youneedcheckactivefilteraconditionandforthisyoucanusebelowcode$products=Mage::getModel('ca

php - 如何在 prestashop 的父类别中显示子类别?

正如您在这张图片中所做的那样,您可以将鼠标悬停在导航按钮“Eliquids”上,下拉菜单中将显示4个类别。我所有的产品都包含在这四个类别中,但是,如果您单击“Eliquids”这个词本身,它会将您带到一个空白页面,因为所有产品都存储在它们各自的类别中。在左侧,您可以看到侧边导航栏中显示的类别。我怎样才能让所有四个子类别(Chef'sBlends、steamgunk等)都显示在“Eliquids”类别中?这是否可以通过后台办公室实现,因为我自己似乎找不到。否则,是否属于编辑源代码的情况?版本:Prestashop1.6.0.9主题:Prestashop默认Bootstrap主题

php - 限制复选框的选择(一次一个类别和一个子类别)

我的WordPress站点中有一个类别菜单列表,其代码如下:BallsandsportitemsBeauty&HealthBeautyCosmeticsHaircareSkincarenutritionClothing,Shoes&JewelryAccessories&JewelryClothingHandbagsShoes看起来像这样:http://prntscr.com/78hm0o现在我希望用户可以一次选择一个主类别及其任何一个子类别(如果存在子类别)。到目前为止我尝试了什么:$(':checkbox').on('change',function(){va

php - 在 HTML SELECT 中列出类别和子类别

我想在选择列表(下拉列表)中显示类别和子类别,如下图所示。这是我在PHP中尝试的方式://Fetchalltherecords:while($stmt->fetch()){$cats[$parent][$id]=$name;}functiondisplayList(&$cats,$parent,$level=0){if($parent==0){foreach($cats[$parent]as$id=>$nm){displayList($cats,$id);}}else{foreach($cats[$parent]as$id=>$nm){echo"$nm\n";if(isset($cat

php - 限制购物车项目来自 WooCommerce 中的同一产品类别

当购物车中添加了具有特殊产品类别“cat_x”的商品并显示一些不同的自定义通知时,我正在使用下面的代码从购物车中删除其他WooCommerce产品类别商品。代码来自thisthread并且效果很好:add_action('woocommerce_check_cart_items','checking_cart_items');functionchecking_cart_items(){$special=false;$catx='cat_x';$number_of_items=sizeof(WC()->cart->get_cart());if($number_of_items>0){//

php - 如何以编程方式获取 Magento 2 模型中商店的根类别 ID

如何从自定义模型中获取Magento2中给定商店的根类别的category_id(或Magento\Catalog\Model\Category本身)?在Magento1.x中,我会简单地使用Mage::app()->getStore($storeId)->getRootCategoryId();我试图从StoreManager获取Store对象,但我找不到根类别的任何文档 最佳答案 _storeManager=$_storeManager;}publicfunctiongetRootCategoryId(){$store=1;$r

php - woocommerce 类别深度作为 if 语句的条件

我不确定在此处进行的最佳方式。我有这样布局的类别(简化版):-fruit--apple---large---small--banana---var1----large----small---var2----small----large我想使用类别的深度作为if语句中的条件来实现如下目的:如果类别深度为2(苹果>大),则执行此操作否则,如果类别是深度3(banana>var1>small),则执行其他操作。我试过使用这里的函数,但除了一个空数组之外什么都得不到!http://www.devdevote.com/cms/wordpress-hacks/get_depth.html

php - Wordpress 当前类别的子类别列表

我如何列出当前类别的子类别列表。我会尝试get_categories代码,但我不能。像那样;$args=array('child_of'=>term_id);$categories=get_categories($args);foreach($categoriesas$category){echo'Category:term_id).'"title="'.sprintf(__("Viewallpostsin%s"),$category->name).'"'.'>'.$category->name.'';echo'Description:'.$category->description.

php - 如何设置类别列表限制?

我是显示postcategorychildlist.listdisplayall我只需要显示6(child)帮助我们...例如:菜单(父级)列表1(child)list2(child)list3(child)list4(child)list5(child)list6(child)list7(child)list8(child)get_category_by_slug('work')->term_id));$talentChildren=get_categories(array('child_of'=>get_category_by_slug('talent')->term_id));?

php - 如果产品属于特定类别 WooCommerce,我如何设置选项卡(仅)

我有一个选项卡集来添加一个包含WooCommerce规范的选项卡。我想将它包装到一个if语句中,以便仅在产品属于某个类别时才设置选项卡。add_filter('woocommerce_product_tabs','woo_custom_product_tabs');functionwoo_custom_product_tabs($tabs){global$post;if($product->is_category("MobilePhones")){$tabs['custom_specification']=array('title'=>__('Specification','wooco